package com.litxuf.logic.core;

import com.litxuf.logic.admin.manager.UserAdminManager;
import com.litxuf.logic.equipment.manager.EquipmentManager;
import com.litxuf.logic.member.manager.MemberManager;
import com.litxuf.util.mail.JavaMailSend;

/**
 * 
 * @author Gui Shiwei
 * @version 1.0
 */
public class ManagerFactory {
	ApplicationContextUtil ctx = ApplicationContextUtil.getContext();

	private String msg = null;

	private UserAdminManager adminManager;

	private com.litxuf.util.mail.JavaMailSend javaMailSend;

	private MemberManager memberManager;

	private EquipmentManager equipmentManager;

	protected ManagerFactory() {

		javaMailSend = (JavaMailSend) ctx.getBean("templateEmail",
				JavaMailSend.class);

		memberManager = (MemberManager) ctx.getBean("memberManager",
				MemberManager.class);

		equipmentManager = (EquipmentManager) ctx.getBean("equipmentManager",
				EquipmentManager.class);

		adminManager = (UserAdminManager) ctx.getBean("userAdminManager",
				UserAdminManager.class);

	}

	private static ManagerFactory factory = new ManagerFactory();

	public static ManagerFactory getFactory() {
		return factory;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public ApplicationContextUtil getCtx() {
		return ctx;
	}

	public void setCtx(ApplicationContextUtil ctx) {
		this.ctx = ctx;
	}

	public UserAdminManager getAdminManager() {
		return adminManager;
	}

	public void setAdminManager(UserAdminManager adminManager) {
		this.adminManager = adminManager;
	}

	public static void setFactory(ManagerFactory factory) {
		ManagerFactory.factory = factory;
	}

	public MemberManager getMemberManager() {
		return memberManager;
	}

	public void setMemberManager(MemberManager memberManager) {
		this.memberManager = memberManager;
	}

	public com.litxuf.util.mail.JavaMailSend getJavaMailSend() {
		return javaMailSend;
	}

	public void setJavaMailSend(com.litxuf.util.mail.JavaMailSend javaMailSend) {
		this.javaMailSend = javaMailSend;
	}

	public EquipmentManager getEquipmentManager() {
		return equipmentManager;
	}

	public void setEquipmentManager(EquipmentManager equipmentManager) {
		this.equipmentManager = equipmentManager;
	}

}
